<?php
/*
 * Created on 2012-2-29
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
ob_start();
include("../../nncms_manager_inc.php");
include ($nncms_config_path. "nn_cms_config/nn_cms_global.php");
//加载多语言
include_once($nncms_config_path.'nn_cms_manager/nncms_mlang.php');
include $nncms_config_path. "nn_cms_manager/controls/nncms_controls_check_login.php";
//导入语言包
if (isset($_SESSION["language_dir"])){
	$language_dir=$_SESSION["language_dir"];
}
//include $nncms_config_path. "nn_cms_manager/languages/". $language_dir. "/language.php";
include $nncms_config_path. "nn_cms_manager/languages/language_contant.php";
include_once $nncms_config_path. "nn_cms_manager/controls/nncms_controls_public_function.php";


//获取权限检查类
include $nncms_db_path. "nns_pri/nns_db_pri_class.php";
$checkpri=new nns_db_pri_class();

$action=$_GET["action"];
$nns_id=$_GET["nns_id"];
$view_type=$_GET["view_type"];
$pri_bool=false;
$pri_bool=$checkpri->nns_db_pri_check($_SESSION["nns_role_pris"],"107101");
$checkpri=null;



if (!$pri_bool){
	Header("Location: ../nncms_content_wrong.php");
}else{

	include ($nncms_db_path. "nns_common/nns_db_constant.php");


	include ($nncms_db_path. "nns_vod/nns_db_live_index_class.php");

	// echo $nncms_db_path. "nns_role/nns_db_role_class.php";
	// include($nncms_db_path. "nns_pri/nns_db_pri_class.php");


	include $nncms_db_path. "nns_vod/nns_db_live_class.php";
	$live_inst=new nns_db_live_class();
	if (!empty($nns_id)){
		$live_info=$live_inst->nns_db_live_info($nns_id,"*");
		$live_inst=null;
	}else{
		echo "<script>alert('".$live_info["reason"] ."');self.location='nncms_content_vodlist.php';</script>";
	}
	if ($live_info["ret"]!=0){
		echo "<script>alert('".$live_info["reason"] ."');self.location='nncms_content_vodlist.php';</script>";
	}

	$edit_data=$live_info["data"][0];
	//		$live_inst=null;
	//	$edit_pri=$edit_data["nns_pri_id"];

	$live_indexes_inst=new nns_db_live_index_class();

	include $nncms_db_path. "nns_carrier/nns_db_carrier_class.php";
	include $nncms_db_path. "nns_partner/nns_db_partner_class.php";
	include $nncms_db_path. "nns_group/nns_db_group_class.php";
	$carrier_inst=new nns_db_carrier_class();
	$partner_inst=new nns_db_partner_class();
	$group_inst=new nns_db_group_class();
	if ($_SESSION["nns_manager_type"]==0){

		$carrier_result=$carrier_inst->nns_db_carrier_list();

		if ($carrier_result["ret"]==0){
			$carrier_data=$carrier_result["data"][0];
		}
		if ($action=="edit"){
			//		 $partner_inst=new nns_db_partner_class();
			$partner_result=$partner_inst->nns_db_partner_info($edit_data["nns_org_id"]);

			if ($partner_result["ret"]==0){
				$partner_data=$partner_result["data"][0];
			}

			//		 $group_inst=new nns_db_group_class();
			$group_result=$group_inst->nns_db_group_info($edit_data["nns_org_id"]);

			if ($group_result["ret"]==0){
				$group_data=$group_result["data"][0];
			}
		}
	}


	//	类型为合作伙伴
	if ($_SESSION["nns_manager_type"]==1){

		$partner_result=$partner_inst->nns_db_partner_info($_SESSION["nns_org_id"]);

		if ($partner_result["ret"]==0){
			$partner_data=$partner_result["data"][0];
		}
		//	类型为集团
	}else if ($_SESSION["nns_manager_type"]==2){

		$group_result=$group_inst->nns_db_group_info($_SESSION["nns_org_id"]);

		if ($group_result["ret"]==0){
			$group_data=$group_result["data"][0];
		}
	}
	ob_end_clean();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="../../css/allstyle.css" rel="stylesheet" type="text/css" />
<link href="../../css/rightframestyle.css" rel="stylesheet" type="text/css" />
<link href="../../css/selectbox.css" rel="stylesheet" type="text/css" />
<link href="../../css/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../../js/jquery-1.4.3.min.js"></script>
<script language="javascript" src="../../js/table.js.php"></script>
</head>

<body>
<div class="content">
	<!--<div class="content_position"><?php echo cms_get_lang('dbgl');?> > <?php if ($view_type==0){ echo cms_get_lang('media_dy|dbgl');} else if ($view_type==1){echo cms_get_lang('media_lxj|dbgl');}?></div>-->
	<div class="content_table">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tbody>
			<tr>
				<td width="120"><?php echo cms_get_lang('media_mtid')?>:</td>
				<td><?php echo $edit_data["nns_id"];?></td>

			</tr>
			<tr>
				<td width="120"><?php echo cms_get_lang('media_mtmc');?>:</td>
				<td><?php echo $edit_data["nns_name"];?></td>

			</tr>

			  <tr>
			  <td width="120"><?php if ($view_type==0){ echo cms_get_lang('media_dy|name');
			  }else if ($view_type==1){ echo cms_get_lang('media_lxj|name');}?>:</td>
				<td><?php echo $edit_data["nns_name"];?></td>

			</tr>

			<tr class="select_carrier_class">
				<td width="120"><?php echo cms_get_lang('group');?>:</td>
				<td><?php if ($edit_data["nns_org_type"]==0){
					echo $carrier_data["nns_name"];
				}else if ($edit_data["nns_org_type"]==1){
					echo $partner_data["nns_name"];
				} if ($edit_data["nns_org_type"]==2){
					echo $group_data["nns_name"];
				}?>
				</td>
			</tr>


			<tr>
				<td width="120"><?php echo cms_get_lang('zdgl_zdscbj');?>:</td>
				<td>
<?php for($device_num=0; $device_num<$g_manager_list_device_num; $device_num++){

	if ($edit_data["nns_tag". $device_num]==1){echo $device_num."&nbsp;&nbsp;&nbsp;&nbsp;";}

} ?>
				</td>
			</tr>

<?php for($live_current_index=1;$live_current_index<=$edit_data["nns_all_index"];$live_current_index++){

	$num=0;

	$live_indexes_info=$live_indexes_inst->nns_db_live_index_info($nns_id,$live_current_index-1);
	$index_intor_data=$live_indexes_info["data"][0];
?>

			<tr>
				<td colspan="2"   ><div class="radiolist"  style="padding:3px 10px;"><div class="radiogroup"><h3><?php echo cms_get_lang('media_zb');?>
					&nbsp;&nbsp;&nbsp;&nbsp;<input name="" type="button" value="<?php echo cms_get_lang('media_control_bjjj');?>"
					onclick="self.location='../media_pages/nncms_content_media_intor.php?view_type=<?php echo $view_type;?>&nns_id=<?php echo $nns_id;?>&index=<?php echo $live_current_index-1;?>';"
					style="margin-top:-3px;"/>
				</h3>
				</div></div></td>
			</tr>
			  <tr >
				<td width="120" style="padding-left:20px;"><?php echo cms_get_lang('name');?>:</td>
				<td><?php echo $index_intor_data["nns_name"];?></td>
			</tr>
			<tr>
				<td width="120" style="padding-left:20px;"><?php echo cms_get_lang('media_index_sc');?>:</td>
				<td><?php echo $index_intor_data["nns_time_len"]/60;?></td>
			</tr>
			 <tr>
				<td width="120" style="padding-left:20px;"><?php echo cms_get_lang('media_bjhb');?>:</td>
				<td>
				<div class="img_content">
					<?php if ($index_intor_data["nns_image"]!=""){?>
				  <div class="img_view">
				  <a href="<?php echo pub_func_get_image_url($index_intor_data["nns_image"]);?>?rand=<?php rand();?>" target="_blank">
				  <img src="<?php echo pub_func_get_image_url($index_intor_data["nns_image"]);?>?rand=<?php rand();?>" style="border:none;" /></a></div>
					<?php }?>
					</div>
			   </td>

			</tr>
			<tr>
				<td width="120" style="padding-left:20px;"><?php echo cms_get_lang('media_index_jj');?>:</td>
				<td><?php echo $index_intor_data["nns_summary"];?></td>

			</tr>

			<?php }?>
		  </tbody>
		</table>
	</div>
	<div class="controlbtns">
		<div class="controlbtn back"><a href="javascript:window.parent.refresh_tree_content();"><?php echo cms_get_lang('back');?></a></div>
		<div style="clear:both;"></div>
	</div>
</div>
<script language="javascript" src="../../js/image_loaded_func.js"></script>
</body>
</html>
<?php }?>